#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		if (a == b)
			cout << c << endl;
		else if (a == c)
			cout << b << endl;
		else
			cout << a << endl;
	}
	return 0;
}
